using Acme.MeiTuan.SDK.Request;
using Acme.MeiTuan.SDK.Request.Order;
using Acme.MeiTuan.SDK.Request.Store;
using Acme.MeiTuan.SDK.Response;
using WebApiClientCore;
using WebApiClientCore.Attributes;
using WebApiClientCore.Parameters;

namespace Acme.MeiTuan.SDK.Api;

[JsonReturn(Enable = true, EnsureMatchAcceptContentType = false)]
public interface IMeiTuanApi : IHttpApi
{
    #region store

    [HttpGet("/api/v1/bill/list/yuan")]
    ITask<BaseResult> BillList([JsonContent] GetBillListDto request);

    #endregion
    
    [HttpPost("/api/v1/image/upload")]
    //[LoggingFilter(Enable = true, LogRequest = true, LogResponse = true)]
    ITask<string> ImageUpload([FormDataContent] ImageUploadDto request, FormDataFile formDataFile);

    [HttpPost("/api/v1/poi/save")]
    ITask<BaseResult> PoiSave([JsonContent] PoiInfoDto request);
        
    
    [HttpPost("/api/v1/poi/shippingtime/update")]
    ITask<BaseResult> ShippingTimeUpdate([JsonContent] ShippingTimeUpdateDto request);
    

    [HttpGet("/api/v1/poi/mget")]
    ITask<BaseResult> PoiMGet([JsonContent] PoiMGetDto request);

    #region goods

    [HttpGet("/api/v1/retail/getSpTagIds")]
    ITask<string> GetSpTagIds([JsonContent] GetSpTagIdsDto request);

    [HttpPost("/api/v1/retailCat/list")]
    ITask<BaseResult> RetailCateList([JsonContent] RetailCateListDto request);

    [HttpPost("/api/v1/retailCat/setSequence")]
    ITask<BaseResult> RetailCateSetSequence([JsonContent] RetailCateSetSequenceDto request);

    [LoggingFilter(Enable = true, LogRequest = true, LogResponse = true)]
    [HttpPost("/api/v1/retailCat/update")]
    ITask<BaseResult> RetailCatUpdate([JsonContent] RetailCatUpdateDto request);

    [HttpPost("/api/v1/retailCat/delete")]
    ITask<BaseResult> RetailCatDelete([JsonContent] RetailCatDeleteDto request);

    [HttpPost("/api/v1/retailCat/batchdelete/catandretail")]
    ITask<BaseResult> RetailBatchdeleteCatandretail([JsonContent] RetailBatchdeleteCatandretailDto request);

    [HttpGet("/api/v1/retail/list")]
    ITask<BaseResult> RetailList([JsonContent] RetailListDto request);

    [HttpPost("/api/v1/retail/initdata")]
    ITask<BaseResult> RetailInitdata([JsonContent] RetailInitdataDto request);

    [LoggingFilter(Enable = true, LogRequest = true, LogResponse = true)]
    [HttpPost("/api/v1/retail/delete")]
    ITask<BaseResult> RetailDelete([JsonContent] RetailDeleteDto request);

    [HttpPost("/api/v1/retail/sku/delete")]
    ITask<BaseResult> RetailSkuDelete([JsonContent] RetailSkuDeleteDto request);

    [HttpPost("/api/v1/retail/updateAppFoodCodeByNameAndSpec")]
    ITask<BaseResult> RetailUpdateAppFoodCodeByNameAndSpec([JsonContent] RetailUpdateAppFoodCodeByNameAndSpecDto request);

    [HttpPost("/api/v1/retail/sellStatus")]
    ITask<BaseResult> RetailSellStatus([JsonContent] RetailSellStatusDto request);

    [HttpPost("/api/v1/retail/sku/price")]
    ITask<BaseResult> RetailSkuPrice([JsonContent] RetailSkuPriceDto request);

    [HttpPost("/api/v1/retail/sku/stock")]
    ITask<BaseResult> RetailSkuStock([JsonContent] RetailSkuStockDto request);

    [HttpPost("/api/v1/retail/setSequence")]
    ITask<BaseResult> RetailSetSequence([JsonContent] RetailSetSequenceDto request);
    
    [HttpPost("/api/v1/retailCat/batchUpdateSpuCategoryRelationship")]
    [LoggingFilter(Enable = true, LogRequest = true, LogResponse = true)]
    ITask<BaseResult> RetailCatBatchUpdateSpuCategoryRelationship([JsonContent] RetailCatBatchUpdateSpuCategoryRelationshipDto request);

    #endregion


    #region order

    /// <summary>
    /// 根据流水号获取订单ID（分段）
    /// 接口限流：5次/秒
    /// 接口说明：
    /// 1.此接口用于商家根据日期、流水号批量查询订单号，仅支持查询近30天内日期的订单。
    /// 2.调用此接口查询订单号，支持部分成功。
    /// </summary>
    /// <returns></returns>
    [HttpGet("/api/v1/ecommerce/order/getOrderIdByDaySeq")]
    ITask<BaseResult> GetOrderIdByDaySeqBatch(GetOrderIdByDaySeqBatchDto request);

    /// <summary>
    /// 根据流水号获取订单ID
    /// 接口限流：20次/秒
    /// 接口说明：
    /// 此接口用于查询近30天内某一个日期的订单号，需根据订单流水号(每日都从1开始)查询对应的订单号。
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/getOrderIdByDaySeq")]
    ITask<BaseResult> GetOrderIdByDaySeq([JsonContent] GetOrderIdByDaySeqDto request);

    /// <summary>
    /// 获取当日最新订单流水号
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/getOrderDaySeq")]
    ITask<BaseResult> GetOrderDaySeq([JsonContent] OrderDaySeqDto request);
    
    [HttpGet("/api/v1/order/preparationMealComplete")]
    ITask<BaseResult> PreparationMealComplete([JsonContent] PreparationMealCompleteDto request);

    /// <summary>
    /// 获取订单详细信息
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/getOrderDetail")]
    ITask<BaseResult> GetOrderDetail([JsonContent] GetOrderDetailDto request);
    /// <summary>
    /// 自配订单配送中（不支持同步骑手信息）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/delivering")]
    ITask<BaseResult> OrderDelivering([JsonContent] OrderDeliveringDto request);
    /// <summary>
    /// 自配订单已送达（不支持同步骑手信息）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/arrived")]
    ITask<BaseResult> OrderArrived([JsonContent] OrderArrivedDto request);
    
    /// <summary>
    /// 商家确认订单（必接）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/confirm")]
    ITask<BaseResult> OrderConfirm([JsonContent] OrderConfirmDto request);
    
    /// <summary>
    /// 商家取消订单（必接）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/cancel")]
    ITask<BaseResult> OrderCancel([JsonContent] OrderCancelDto request);
    
    /// <summary>
    /// 订单确认退款请求（必接）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpGet("/api/v1/order/refund/agree")]
    ITask<BaseResult> RefundAgree([JsonContent] RefundAgreeDto request);
    
    /// <summary>
    /// 驳回订单退款申请（必接）
    /// </summary>
    /// <returns></returns>
    [HttpGet("/api/v1/order/refund/reject")]
    ITask<BaseResult> RefundReject([JsonContent] RefundRejectDto request);
    
    /// <summary>
    /// 发起部分退款
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpPost("/api/v1/order/applyPartRefund")]
    ITask<BaseResult> ApplyPartRefund([JsonContent] ApplyPartRefundDto request);

    [HttpGet("/api/v1/ecommerce/order/getOrderRefundDetail")]
    ITask<BaseResult> GetOrderRefundDetail([JsonContent] GetOrderRefundDetailDto request);

    /// <summary>
    /// 拉取用户真实手机号（必接）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpPost("/api/v1/order/batchPullPhoneNumber")]
    ITask<string> BatchPullPhoneNumber([JsonContent] BatchPullPhoneNumberDto request);
    
    /// <summary>
    /// 拉取骑手真实手机号（必接）
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpPost]
    ITask<string> GetRiderInfoPhoneNumber([JsonContent] GetRiderInfoPhoneNumberDto request);

    #endregion
}